package com.jk.bean;


import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Staff  implements Serializable {


    private Integer staffId;

    private String staffName;

    private String staffPwd;

    private Integer RememberPswd;

    private String  code; //验证码

    private String  email;

    private String  img;

    private String userPhone;

    private Integer status;//1===正常， 2==黑名单

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date time=new Date();

    private String rname;

    private String pname;


    @Override
    public boolean equals(Object o) {
        if (this == o){ return true;}
        if (!(o instanceof Staff)){ return false;}

        Staff staff = (Staff) o;
        return getStaffId().equals(staff.getStaffId()) &&
                getStaffName().equals(staff.getStaffName()) &&
                getStaffPwd().equals(staff.getStaffPwd());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getStaffId(), getStaffName(), getStaffPwd());
    }
}
